import org.openjdk.jol.info.ClassLayout;

public class SyncUpDemo {

    public static void main(String[] args) throws InterruptedException {
        Object obj = new Object();
        System.out.println(obj.hashCode());

        System.out.println(ClassLayout.parseInstance(obj).toPrintable());
        new Thread(() -> {
            synchronized (obj) {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("++" + ClassLayout.parseInstance(obj).toPrintable());
            }
            System.out.println("++" + ClassLayout.parseInstance(obj).toPrintable());
        }).start();
        System.out.println(ClassLayout.parseInstance(obj).toPrintable());
        System.out.println(obj.hashCode());
        System.out.println(ClassLayout.parseInstance(obj).toPrintable());
    }
}
